package org.cli.admin.glassfish.commands;

import org.cli.admin.cli.printer.ConsolePrinter;
import org.cli.admin.cli.printer.ui.SelectItem;
import org.cli.admin.cli.printer.ui.SelectItems;
import org.cli.admin.command.AbstractCommand;
import org.cli.admin.command.Command;

import com.google.inject.Inject;

@Command(name = "glassfish-new", aliases = { "gnew", "gn" }, global = true)
public class GlassfishNewCommand extends AbstractCommand {

	@Inject
	private ConsolePrinter printer;

	private static enum ProcessType {
		DOMAIN, TARGET
	}

	@Override
	public void execute() {

		selectNewProcessType();
	}

	private void selectNewProcessType() {
		SelectItems<ProcessType> selectType = new SelectItems<ProcessType>("What you want to install?");

		selectType.addSelectItem(new SelectItem<ProcessType>("Glassfish installation", ProcessType.DOMAIN));
		selectType.addSelectItem(new SelectItem<ProcessType>("Deploy target", ProcessType.TARGET));

		ProcessType type = printer.printSelectedList(selectType).getValue();

		switch (type) {
		case DOMAIN:
		case TARGET:

			break;

		default:
			break;
		}
	}

}
